<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="format-detection" content="telephone=no">
  <meta name="format-detection" content="email=no">
  <title>资讯</title>
  <script src="../scripts/isPc.js"></script>
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../styles/global.css">
  <link rel="stylesheet" href="../styles/information.css">

</head>

<body>
  <header class="header clearFix">
    <nav class="nav">
      <div class="nav-r">
        <a href="./index.html">
          <img src="../images/logo.png">
          <span>万果田园</span>
        </a>
      </div>
      <ul class="navList">
        <li>
          <a href="./survey.html">概况</a>
        </li>
        <li class="active">
          <a href="javascript:;">资讯</a>
        </li>
        <li>
          <a href="./business.html">业务</a>
        </li>
        <li>
          <a href="./layout.html">布局</a>
        </li>
        <li>
          <a href="./latest.html">动态</a>
        </li>
        <li>
          <a href="./record.html">全程追溯</a>
        </li>
        <li>
          <a href="./introduce-join.html">合作</a>
        </li>
        <li>
          <a href="./download.html">APP下载</a>
        </li>
      </ul>
    </nav>
  </header>
  <div class="main">
    <ul class="information-list">
      <li class="paceholder">
        <div class="paceholder-bg"></div>
        <div class="tc">没有更多资讯了</div>
      </li>
    </ul>
    <ul class="pagination" id="pagination1"></ul>
  </div>
  <footer>
    <div class="footer-top clearfix">
      <div class="foot-l l">
        <p class="phone">电话：400-017-5917</p>
        <p class="email">邮箱：postmaster@wggyl.cn</p>
        <p class="address">地址：北京市丰台区新发地京良桥西南侧2000米路北丰合顺市场5号交易厅商01号</p>
      </div>
      <div class="foot-r r">
        <p>
          <img src="../images/erweima.png" alt="">
        </p>
        <p>扫一扫 关注我们</p>
      </div>
    </div>
    <div class="foot-b">万果供应链有限公司&nbsp;&nbsp;&nbsp;&nbsp;京ICP备17068845号</div>
  </footer>
  <div class="loading">
    <div class="load-gif"></div>
  </div>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  <script src="../scripts/jqPaginator.js"></script>
  <script>
    function getInformationList() {
      // var ip = 'http://192.168.2.222:82'
      var ip = 'https://check-h5.wanguowang.com'
      $('.loading').show()
      $.ajax({
        type: 'post',
        url: ip + '/wap/news/selectInforList',
        dataType: 'json',
        success: function (res) {
          $('.loading').hide()
          if (res.result.state != '1' || !res.data.length) {
            $('.paceholder').show()
            return
          };
          page(res.data);
        }
      });
    };

    function page(data) {
      var length = Math.ceil(data.length / 10)
      $.jqPaginator('#pagination1', {
        totalPages: length,
        visiblePages: 3,
        currentPage: 1,
        first: '',
        last: '',
        prev: '<li class="prev"><a href="javascript:;">上一页</a></li>',
        next: '<li class="next"><a href="javascript:;">下一页</a></li>',
        page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
        onPageChange: function (num, type) {
          var n = (num - 1) * 10,
            html = '',
            length = data.length - n > 10 ? num * 10 : data.length
          for (let i = n; i < length; i++) {
            html +=
              `<li class="list">
                <a href="information-detail.html?id=${data[i].id}">
                  <div class="list-l l"><img src="${data[i].thumb}"></div>
                  <div class="list-r r">
                    <p class="title">${data[i].title}</p>
                    <p class="date">发布时间：${data[i].deplayTime}</p>
                    <p class="cont">${data[i].brief} </p>
                  </div>
                </a>
              </li>`
          };
          $('.information-list').html(html);
        }
      });
    };
    getInformationList()
  </script>
</body>

</html>
